﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ex_4_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }




        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = listBox1.SelectedItems.Count - 1; i >= 0; i--)
            {
                listBox1.Items.Remove(listBox1.SelectedItems[i]);
            }
        }
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            listBox1.Items.Add(comboBox1.Text);
        }

        private void Form1_Load_1(object sender, EventArgs e)
        {
            string[] items = { "java2程序设计", "C#程序设计", "C++程序设计", "ASP.NET实战", "VB.NET实战" };
            comboBox1.Items.AddRange(items);
            listBox1.SelectionMode = SelectionMode.MultiExtended;
        }
    }
}
